﻿<%@ WebHandler Language="C#" Class="WenZhang_edit" %>

using System;
using System.Web;

public class WenZhang_edit : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/html";

        string id = context.Request["id"].Trim();
        string title = context.Request["title"].Trim();
        string menu = context.Request["menu"].Trim();
        string more = context.Request["more"].Trim();
        string state = context.Request["state"].Trim();

        JLL.Model.News news = new JLL.Model.News();

        news.Id = int.Parse(id);
        
        news.Title = title;

        JLL.Model.Menu newsmenu = new JLL.Model.Menu();
        newsmenu.Id = int.Parse(menu);

        news.Menu = newsmenu;

        news.More = more;
        news.State = int.Parse(state);

        if (JLL.BLL.News.update(news))
        {
            JLL.JsHelper.AlertAndRedirect("编辑成功", "/admin/news_list.aspx");
        }
        else
        {
            JLL.JsHelper.AlertAndRedirect("编辑失败", "/admin/news_list.aspx");
        
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}